package com.ruoyi.web.admin.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.web.admin.mapper.TdmCmspMapper;
import com.ruoyi.web.admin.domain.TdmCmsp;
import com.ruoyi.web.admin.service.ITdmCmspService;

/**
 * CMSPService业务层处理
 * 
 * @author ly
 * @date 2022-03-10
 */
@Service
public class TdmCmspServiceImpl implements ITdmCmspService 
{
    @Autowired
    private TdmCmspMapper tdmCmspMapper;

    /**
     * 查询CMSP
     * 
     * @param id CMSP主键
     * @return CMSP
     */
    @Override
    public TdmCmsp selectTdmCmspById(Long id)
    {
        return tdmCmspMapper.selectTdmCmspById(id);
    }

    /**
     * 查询CMSP列表
     * 
     * @param tdmCmsp CMSP
     * @return CMSP
     */
    @Override
    public List<TdmCmsp> selectTdmCmspList(TdmCmsp tdmCmsp)
    {
        return tdmCmspMapper.selectTdmCmspList(tdmCmsp);
    }

    /**
     * 新增CMSP
     * 
     * @param tdmCmsp CMSP
     * @return 结果
     */
    @Override
    public int insertTdmCmsp(TdmCmsp tdmCmsp)
    {
        tdmCmsp.setCreateTime(DateUtils.getNowDate());
        return tdmCmspMapper.insertTdmCmsp(tdmCmsp);
    }

    /**
     * 修改CMSP
     * 
     * @param tdmCmsp CMSP
     * @return 结果
     */
    @Override
    public int updateTdmCmsp(TdmCmsp tdmCmsp)
    {
        tdmCmsp.setUpdateTime(DateUtils.getNowDate());
        return tdmCmspMapper.updateTdmCmsp(tdmCmsp);
    }

    /**
     * 批量删除CMSP
     * 
     * @param ids 需要删除的CMSP主键
     * @return 结果
     */
    @Override
    public int deleteTdmCmspByIds(Long[] ids)
    {
        return tdmCmspMapper.deleteTdmCmspByIds(ids);
    }

    /**
     * 删除CMSP信息
     * 
     * @param id CMSP主键
     * @return 结果
     */
    @Override
    public int deleteTdmCmspById(Long id)
    {
        return tdmCmspMapper.deleteTdmCmspById(id);
    }
}
